package com.study.jvm._2;

public class App {
    //首先会把 所有的动态链接转为静态链接,变量设置为空值(应该是在类加载阶段的递归, 链接-准备和解析阶段)
    //然后按照顺序 执行静态变量代码块等(初始化阶段)
    //最后创建对象


    private static App d = new App();
    private SubClass t = new SubClass();

    static {
        System.out.println(3);
    }

    public App() {
        System.out.println(4);
    }

    public static void main(String[] args) {
        System.out.println("Hello");
    }
}

class SuperClass {
    SuperClass() {
        System.out.println("构造SuperClass");
    }
}

class SubClass extends SuperClass {
    static {
        System.out.println(1);
    }

    public SubClass() {
        System.out.println(2);
    }
}